<?php 
	require 'connection.php';
	
	if(!isLogged())
	{
		header('location:login.php');
	}
	
?>

<?php 
	
	$traktor_id = $_GET['traktor_id'];
	
	if(isset($_POST['submit']))
	{
		
		mysqli_close($db_connect);
		header("Location: index.php");
	}
?>
<html>
<head>
	<title>Delete traktors</title>
</head>
<body>

<?php
	
		echo "<form method=\"post\" action=\"del_traktors.php?traktor_id=$traktor_id\">";
		$query = "DELETE FROM traktor WHERE traktor_id=$traktor_id";
		
		$result = mysqli_query($db_connect, $query);
		echo "Successfully delete the traktor</br>";
	
	
?>
<input type="submit" value="submit" name="submit"/>
</form>
</body>
</html>

<?php
	mysqli_close($db_connect);
?>